<?php

$user  = $this->Session->read('CurrentUser');
$store = $this->Session->read('CurrentStore');

$keys    = Set::extract('{n}.id', $user['Store']);
$values  = Set::extract('{n}.name', $user['Store']);
$options = array_combine($keys, $values);

if (count($user['Store'])>1):
?>
<div id="store-select">
    <?= $this->Form->select('storeSelect', $options, array(
        'value'    => $store['id'],
        'empty'    => false,
        'onchange' => 'location.href=\'/app/setStore/\' + this.value'
    )) ?>
</div>
<? endif ?>